package com.webull.information.center.service;

import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webull.framework.mvc.ApiException;
import com.webull.information.center.dao.InfoTickerDao;
import com.webull.information.center.validator.NewsValidator;
import com.webull.information.client.service.InfoTickerService;

/**
 * @author shimingjun
 * @date 2016年7月11日 下午6:36:24
 * @version 1.0
 * @since JDK 1.8
 */

@Service
public class InfoTickerServiceImpl implements InfoTickerService {
	protected final Logger logger = LogManager.getLogger(getClass());
	private @Autowired NewsValidator newsValidator;
	private @Autowired InfoTickerDao infoTickerDao;

	@Override
	public List<Integer> searchTickersByNewId(Long newsId) throws ApiException {
		newsValidator.validateGetByLongId(newsId);
		return infoTickerDao.searchStocksByNewId(newsId);
	}

}
